package org.snail.common.xmlBean;

import lombok.Data;

import javax.xml.bind.annotation.XmlElement;
import java.io.Serializable;
@Data
public class Group implements Serializable {

    private Long id;
    private String chatId;
    private String webhookurl;
    private String groupName;
    private String groupClassificationName;

    public Group() {
    }

    public Group(String webhookurl, String groupName) {
        this.webhookurl = webhookurl;
        this.groupName = groupName;
    }

    public Group(String webhookurl, String groupName, String groupClassificationName) {
        this.webhookurl = webhookurl;
        this.groupName = groupName;
        this.groupClassificationName = groupClassificationName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Group)) return false;

        Group group = (Group) o;

        if (!getChatId().equals(group.getChatId())) return false;
        if (!getWebhookurl().equals(group.getWebhookurl())) return false;
        if (!getGroupName().equals(group.getGroupName())) return false;
        return getGroupClassificationName().equals(group.getGroupClassificationName());

    }

    @Override
    public int hashCode() {
        int result = getChatId().hashCode();
        result = 31 * result + getWebhookurl().hashCode();
        result = 31 * result + getGroupName().hashCode();
        result = 31 * result + getGroupClassificationName().hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "Group{" +
                "chatId='" + chatId + '\'' +
                ", webhookurl='" + webhookurl + '\'' +
                ", groupName='" + groupName + '\'' +
                ", groupClassificationName='" + groupClassificationName + '\'' +
                '}';
    }
}